package net.godbirds.market.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import net.godbirds.bean.Store;
import net.godbirds.market.service.StoreService;
import net.godbirds.market.service.WelcomeService;

@Controller
public class StoreController {
	@Autowired
	WelcomeService welcomeService;
	@Autowired
	StoreService storeService;
	
	@GetMapping("/storeProductUrl")
	public String getStoreProduct(HttpServletRequest request,@RequestParam("storeId") Long storeId) {
		//逻辑处理
		Store store = storeService.getStoreById(storeId);
		request.setAttribute("store",store);
		request.setAttribute("user", "001");
		return "store-product::product";
	}
}
